#:kivy 2.0.0
MainLayout:
<MainLayout>:
    canvas.before:
        Color:
            rgba: 0.15, 0.15, 0.15, 1
        Rectangle:
            pos: self.pos
            size: self.size
    orientation: "vertical"
    Label:
        font_name: "../lib/fonts/msyh.ttc"
        font_size: "34dp"
        text: "在 MCbe 里添加任何 2D 粒子特效！"
        size_hint: 1, 0.5
    RelativeLayout:
        canvas:
            Line:
                points: (dp(50), self.height, self.width - dp(50), self.height)
        size_hint: 1, 0.1
    BoxLayout:
        padding: "20dp"
        size_hint: 1, 0.5
        Label:
            font_name: "../lib/fonts/msyh.ttc"
            font_size: "18dp"
            text: "SVG 文件路径："
            size_hint: 0.2, 1
        TextInput:
            id: svg
            text: ""
            padding: "13dp"
            multiline: False
            font_name: "../lib/fonts/msyh.ttc"
            font_size: "18dp"
            size_hint: 0.8, None
            height: "60dp"
            pos_hint: {"center_x":0.5, "center_y":0.5}
            on_text_validate: root.svg_path_validate(self)
            background_color: (.8,.8,.8)
            cursor_color: (.1, .1, .1)
    BoxLayout:
        padding: "20dp"
        size_hint: 1, 0.5
        Label:
            font_name: "../lib/fonts/msyh.ttc"
            font_size: "18dp"
            text: "世界路径："
            size_hint: 0.2, 1
        TextInput:
            id: world
            text: ""
            padding: "13dp"
            multiline: False
            font_name: "../lib/fonts/msyh.ttc"
            font_size: "18dp"
            size_hint: 0.8, None
            height: "60dp"
            pos_hint: {"center_x":0.5, "center_y":0.5}
            on_text_validate: root.world_path_validate(self)
            background_color: (.8,.8,.8)
            cursor_color: (.1, .1, .1)
    BoxLayout:
        padding: "20dp"
        size_hint: 1, 1
        BoxLayout:
            padding: "10dp"
            orientation: "vertical"
            Label:
                font_name: "../lib/fonts/msyh.ttc"
                font_size: "18dp"
                text: "缩放倍数"
                size_hint: 0.2, 1.5
                pos_hint: {"center_x":0.5}
            TextInput:
                id: scale
                text: "1.0"
                padding: "13dp"
                multiline: False
                font_name: "../lib/fonts/msyh.ttc"
                font_size: "18dp"
                size_hint: 0.8, None
                height: "60dp"
                pos_hint: {"center_x":0.5, "center_y":0.1}
                background_color: (.8,.8,.8)
                cursor_color: (.1, .1, .1)
                on_text_validate: root.float_validate(self)
        BoxLayout:
            padding: "10dp"
            orientation: "vertical"
            Label:
                font_name: "../lib/fonts/msyh.ttc"
                font_size: "18dp"
                text: "盔甲架数量"
                size_hint: 0.2, 1.5
                pos_hint: {"center_x":0.5}
            TextInput:
                id: count
                text: "101"
                padding: "13dp"
                multiline: False
                font_name: "../lib/fonts/msyh.ttc"
                font_size: "18dp"
                size_hint: 0.8, None
                height: "60dp"
                pos_hint: {"center_x":0.5, "center_y":0.1}
                background_color: (.8,.8,.8)
                cursor_color: (.1, .1, .1)
                on_text_validate: root.int_validate(self)
        BoxLayout:
            padding: "10dp"
            orientation: "vertical"
            Label:
                font_name: "../lib/fonts/msyh.ttc"
                font_size: "18dp"
                text: "原点"
                size_hint: 0.2, 1.5
                pos_hint: {"center_x":0.5}
            TextInput:
                id: origin
                text: "0, -60, 0"
                padding: "13dp"
                multiline: False
                font_name: "../lib/fonts/msyh.ttc"
                font_size: "18dp"
                size_hint: 0.8, None
                height: "60dp"
                pos_hint: {"center_x":0.5, "center_y":0.1}
                background_color: (.8,.8,.8)
                cursor_color: (.1, .1, .1)
                on_text_validate: root.tuple_validate(self)
    Button:
        background_color: (.7, .7, .7)
        text:"一键生成"
        on_press: root.generate(self, svg, world, scale, count, origin)
        on_release: self.background_color = (.7, .7, .7)
        font_name: "../lib/fonts/msyh.ttc"
        font_size: "18dp"
        size_hint: None, None
        size: "400dp", "100dp"
        pos_hint: {"center_x":0.5, "center_y":0.5}

    Label:
        text: ""
        size_hint: None, None
        height: "20dp"
        